#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
int isPalindrome(int x)
{
    if (x == 0)
    {
        return 1;
    }
    else if (x < 0)
    {
        return 0;
    }
    else
    {
        int len = 0;
        int tmp = x;
        int y = 0;
        while (tmp)
        {
            tmp /= 10;
            len++;
        }
        tmp = x;
        while (len)
        {
            y += tmp % 10 * pow(10, len - 1);
            tmp = (tmp - tmp % 10) / 10;
            len--;
        }
        if (x == y)
        {
            return 1;
        }
        else
        {
            return 0;
        }

    }

}
int main()
{
    int num = 0;
    scanf("%d", &num);
    printf("%d", isPalindrome(num));
    return 0;
}